Skip to content

Conversation

@britaniar
Copy link
Collaborator

@britaniar britaniar commented Nov 25, 2025

Description of your changes

I have:

  • Update the update run controller to use State from the Spec to determine whether to Initialize or Execute.

  • Update Initialized condition to use Unknown status as it starting to initialize and have the update run status reflect that.

  • Updated conditional checks to disregard generation checks as update run is immutable but the State field.

  • Added/update integrations tests and e2e tests.

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

  • Integration Tests
  • E2E Test

Special notes for your reviewer

This change covers when update run starts as state Initialize then to Execute or starts at state Execute.
The initialized condition should be successfully initialized once. Therefore, the generation should always be 1 for update runs Initialized condition.

Generation will change each time update run state is updated and only when the state is updated. The rest of update run spec is immutable. Can correlate generation with state change.

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@britaniar britaniar force-pushed the startStopImplementation branch 2 times, most recently from 07c7ac6 to 6a68b64 Compare November 25, 2025 19:43
@britaniar britaniar marked this pull request as ready for review November 25, 2025 20:12
Copilot finished reviewing on behalf of ryanzhang-oss November 25, 2025 23:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements the Start/Stop API for update runs, introducing state-based control over update run execution. The changes enable users to create update runs in a NotStarted state, transition them to Started to begin execution, Stopped to pause, and Abandoned to terminate. Key changes include:

  • Updated the updateRun controller to use State from the Spec to determine execution flow
  • Modified conditional checks to disregard generation for immutable fields (only State changes)
  • Refactored executeUpdatingStage into smaller helper methods to reduce complexity
  • Added comprehensive integration and E2E tests for state transitions

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/controllers/updaterun/controller.go Added state-based execution control with early checks for Abandoned/Stopped states; modified initialization logic to ignore generation changes
pkg/controllers/updaterun/execution.go Refactored executeUpdatingStage into smaller helper methods; removed generation checks from condition evaluations
pkg/controllers/updaterun/validation.go Updated condition checks to be generation-independent for succeeded/failed states
pkg/utils/condition/reason.go Added new condition reasons: UpdateRunPausedReason and UpdateRunAbandonedReason
test/e2e/staged_updaterun_test.go Updated all createStagedUpdateRunSucceed calls to include state parameter; added comprehensive E2E test for state transitions
test/e2e/cluster_staged_updaterun_test.go Updated all createClusterStagedUpdateRunSucceed calls to include state parameter; added E2E test for cluster-scoped state transitions
test/e2e/actuals_test.go Added helper functions for validating NotStarted, Stopped, and Abandoned states; refactored status building logic
pkg/controllers/updaterun/*_integration_test.go Updated test helpers to use reason strings; added integration tests for NotStarted/Stopped/Abandoned states

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

@britaniar britaniar marked this pull request as draft November 26, 2025 18:49
Signed-off-by: Britania Rodriguez Reyes <[email protected]>
@britaniar britaniar force-pushed the startStopImplementation branch 2 times, most recently from 7d2cf9e to c88d0d0 Compare November 26, 2025 20:24
@britaniar britaniar changed the title feat: Start/Stop API Implementation feat: implement initialize and execute states within update run Nov 26, 2025
@britaniar britaniar marked this pull request as ready for review November 26, 2025 22:18
Signed-off-by: Britania Rodriguez Reyes <[email protected]>
@britaniar britaniar force-pushed the startStopImplementation branch from be4dba0 to b44f61f Compare November 27, 2025 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants